]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/icon-theme: Remove Win32 compatibility
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 26 Jan 2023 00:41:32 +0000 (01:41 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 2 Feb 2023 20:45:06 +0000 (20:45 +0000)
gnome-shell does not run on Windows, and if someone was crazy enough
to try to make it work, the icon theme support would be the least
of their worries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2620>

src/st/st-icon-cache.c
src/st/st-icon-theme.c

index 4891d41164fbaf915b522c0d3bee463c50a3176a..d29cfd6218c0ac0f20ceed036a3adc28dc15b67e 100644 (file)
@@ -28,9 +28,6 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef G_OS_WIN32
-#include <io.h>
-#endif
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -104,20 +101,6 @@ _gtk_icon_cache_new_for_path (const char *path)
   if (fd < 0)
     goto done;
 
-#ifdef G_OS_WIN32
-
-/* Bug 660730: _fstat32 is only defined in msvcrt80.dll+/VS 2005+ */
-/*             or possibly in the msvcrt.dll linked to by the Windows DDK */
-/*             (will need to check on the Windows DDK part later) */
-#if ((_MSC_VER >= 1400 || __MSVCRT_VERSION__ >= 0x0800) || defined (__MINGW64_VERSION_MAJOR)) && !defined(_WIN64)
-#undef fstat /* Just in case */
-#define fstat _fstat32  
-#elif defined(__MINGW64_VERSION_MAJOR) && defined(_WIN64)
-#undef fstat
-#define fstat _fstat64
-#endif
-#endif
-
   if (fstat (fd, &st) < 0 || st.st_size < 4)
     goto done;
 
index fae41bc7c422c425de1d3b6f52bcd7740b5d1d62..6c569663c877057837e616798330c9d74b1d93bb 100644 (file)
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <string.h>
 #include <stdlib.h>
 #include <math.h>
 #include <glib.h>
 #include <glib/gstdio.h>
 
-#ifdef G_OS_WIN32
-#ifndef S_ISDIR
-#define S_ISDIR(mode) ((mode)&_S_IFDIR)
-#endif
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <shellapi.h>
-#include "win32/gdkwin32.h"
-#endif /* G_OS_WIN32 */
-
 #include "st-icon-theme.h"
 #include "gtkcsspalettevalueprivate.h"
 #include "gtkcssrgbavalueprivate.h"
 
 #include "deprecated/gtkstyle.h"
 
-/* this is in case round() is not provided by the compiler, 
- * such as in the case of C89 compilers, like MSVC
- */
-#include "fallback-c89.c"
-
 #define DEFAULT_ICON_THEME "Adwaita"
 
 /**
@@ -1768,30 +1751,6 @@ real_choose_icon (GtkIconTheme       *icon_theme,
       if (unthemed_icon)
         break;
     }
-#ifdef G_OS_WIN32
-  /* Still not found an icon, check if reference to a Win32 resource */
-  if (!unthemed_icon)
-    {
-      char **resources;
-      HICON hIcon = NULL;
-      
-      resources = g_strsplit (icon_names[0], ",", 0);
-      if (resources[0])
-        {
-          wchar_t *wfile = g_utf8_to_utf16 (resources[0], -1, NULL, NULL, NULL);
-          ExtractIconExW (wfile, resources[1] ? atoi (resources[1]) : 0, &hIcon, NULL, 1);
-          g_free (wfile);
-        }
-      
-      if (hIcon)
-        {
-          icon_info = icon_info_new (ICON_THEME_DIR_UNTHEMED, size, 1);
-          icon_info->cache_pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon, NULL, NULL);
-          DestroyIcon (hIcon);
-        }
-      g_strfreev (resources);
-    }
-#endif
 
   if (unthemed_icon)
     {